#ifndef _VN_PLAYER_HEALTH_COMPONENT_H_
#define _VN_PLAYER_HEALTH_COMPONENT_H_

#include "..\Graphics\RectangleShape.h"
#include "..\Graphics\Sprite.h"


#include "HealthComponent.h"

class ComponentVisitor;
class PlayerHealthComponent : public HealthComponent
{
public:
	PlayerHealthComponent(const vn::Vector2& p_position, int p_minHealth, int p_maxHealth, float p_delay);
	virtual ~PlayerHealthComponent(void);

	virtual void init();
	virtual void update(const GameTime& p_gameTime);

	virtual void decreaseHealth(int);
	virtual void increaseHealth(int);
	virtual void setHealth(int);

	void acceptVisitor(ComponentVisitor* p_componentVisitor);

protected:
	inline void synchronize();

	float m_barStart;

	vn::Vector2 m_position;

	vn::Sprite* m_bar;
	vn::Sprite* m_middle;
	vn::Sprite* m_bot;
	vn::Sprite* m_top;

};

#endif // _VN_PLAYER_HEALTH_COMPONENT_H_